<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupGLCanvasBox</title>

<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style3 {
	font-size: large;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupGLCanvasBox <span class="style3">(since 3.11)</span></h2>
<p>Creates an OpenGL canvas container. It inherits from
<a href="../ctrl/iupglcanvas.html">IupGLCanvas</a>.</p>
<p>This is an additional control that depends on the OpenGL library. It is included 
in the 
<a href="../iupglcontrols.html">IupGLControls</a> library.</p>
<p>To use the controls available in the <strong>IupGLControls</strong> library 
inside your OpenGL canvas you must replace the <strong>IupGLCanvas</strong> by 
the <strong>IupGLCanvasBox</strong> element.</p>
<p>It can have any number of children. Controls from the <strong>
IupGLControls</strong> library can be used as children along with the void 
containers such as <strong>IupHbox</strong>, <strong>IupVbox</strong>, and so 
on, including <strong>IupFill</strong>. Native elements can also be placed on 
top although they will not be clipped by <strong>IupGLFrame</strong> and other
<strong>IupGlControls</strong> containers.</p>
<p>The elements that are a direct child of the box can be positioned using the 
VERTICALALIGN and/or HORIZONTALALIGN attributes, or using a position in pixels 
relative to the top-left corner of the box by setting the attribute
<a href="../attrib/iup_position.html">POSITION</a>.</p>
<p>Each direct children will be sized to its natural size by default, except if 
EXPANDHORIZONTAL or EXPANDVERTICAL are set.</p>

<p>The box can be created with no elements and be dynamic filled using
  <a href="../func/iupappend.html">IupAppend</a> or
<a href="../func/iupinsert.html">IupInsert</a>.</p>
<h3><a name="Creation">Creation</a></h3>
<div>
  <pre>Ihandle* IupGLCanvasBox(Ihandle *<strong>child</strong>, ...); [in C]
Ihandle* IupGLCanvasBoxV(Ihandle* <strong>child</strong>, va_list <strong>arglist</strong>); [in C]
Ihandle* IupGLCanvasBoxv(Ihandle **<strong>children</strong>); [in C]
iup.glcanvasbox{<strong>child</strong>, ...: ihandle} -&gt; (<strong>elem</strong>: ihandle) [in Lua]
glcanvasbox(<strong>child</strong>, ...) [in LED]</pre>
</div>
  <p><strong>child</strong>, ... : List of the identifiers that will be placed 
  in the box. NULL must be used to define the end of the list in C. It can be 
  empty, but in C must have at least the NULL terminator..</p>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


<p>The 
  <strong>IupGLCanvasBox</strong> element handle all attributes defined for an 
OpenGL canvas and a conventional canvas, 
  see
<a href="../ctrl/iupglcanvas.html">IupGLCanvas</a> and <a href="../elem/iupcanvas.html">IupCanvas</a>.</p>
<blockquote>
  <hr>
</blockquote>
  <p><b>MARGIN</b> (<font size="3">non inheritable</font>): Defines a margin in 
  pixels. Its value 
  has the format &quot;<i>width</i>x<i>height</i>&quot;,
  where <i>
  width</i> 
  and <i>height</i> are integer values corresponding to the horizontal and 
  vertical margins, respectively. Default: &quot;0x0&quot; (no margin).</p>
<p><strong>REDRAW</strong> (<font size="3">non inheritable, write-only</font>): 
force a full redraw of all elements and the main canvas.</p>

  <blockquote>
    <hr>
</blockquote>

  <p>
  <a href="../attrib/iup_clientsize.html">CLIENTSIZE</a>, 
	<a href="../attrib/iup_clientoffset.html">CLIENTOFFSET</a>: 
also accepted.</p>

<h3>Attributes (at Children)</h3>


<p><strong>HORIZONTALALIGN</strong> (<font SIZE="3">non inheritable</font>) <strong>(at children only)</strong>:
  Horizontally aligns the element inside the box. Possible 
  values: &quot;ALEFT&quot;, &quot;ACENTER&quot;, &quot;ARIGHT&quot; or &quot;FLOAT&quot;. Default: &quot;FLOAT&quot;. 
When FLOAT is used its horizontal position is obtained from the
<a href="../attrib/iup_position.html">POSITION</a> attribute.</p>

  <p><strong>VERTICALALIGN</strong> (<font SIZE="3">non inheritable</font>) <strong>(at children only)</strong>: 
Vertically aligns the element inside the box. Possible values: &quot;ATOP&quot;, 
&quot;ACENTER&quot;, &quot;ABOTTOM&quot; or &quot;FLOAT&quot;. Default: &quot;FLOAT&quot;. When FLOAT is used 
its vertical position is obtained from the <a href="../attrib/iup_position.html">
POSITION</a> attribute.</p>


<p><strong>EXPANDHORIZONTAL</strong> (<font SIZE="3">non inheritable</font>) <strong>(at children only)</strong>:
  Expand the horizontal size of the element to the box width. Works only if 
EXPAND=Yes or HORIZONTAL. Can be Yes or No. 
Default: No. (since 3.13)</p>


<p><strong>EXPAND<span lang="pt-br">VERTICAL</span></strong> (<font SIZE="3">non inheritable</font>) <strong>(at children only)</strong>:
  Expand the vertical size of the element to the box height. Works only if 
EXPAND=Yes or VERTICAL. Can be Yes or No. 
Default: No. (since 3.13)</p>

<h3><a name="Callbacks">Callbacks</a></h3>

<p>The 
  <strong>IupGLCanvasBox</strong> element understands all callbacks defined for 
the
<a href="../ctrl/iupglcanvas.html">IupGLCanvas</a>.</p>
<p>But since it has to forward the mouse and action callbacks to the <strong>
IupGLControls</strong> elements when it is mapped the callbacks ACTION, 
BUTTON_CB, MOTION_CB, WHEEL_CB, and LEAVEWINDOW_CB are replaced by internal 
callbacks. The application callbacks will still be called and they can be 
retrieved by using the prefix &quot;APP_&quot; on the callback name. If for some reason 
the application set one of these callbacks after being mapped, the box internal 
callback can be retrieved by using the prefix &quot;GLBOX_&quot; on the callback name. </p>
<p>Keyboard focus is NOT processed for 
  <strong>IupGLCanvasBox</strong> children.</p>
<p>The <strong>IupGLCanvas</strong> SWAPBUFFERS_CB callback is used internally 
to enable a correct display for the box children. This means that when the 
application calls <strong>IupGLSwapBuffers</strong>, then children will be drawn 
before actually swapping the double buffer.</p>
<h3><a name="Examples">Examples</a></h3>
<p><a href="../../examples/">Browse for Example Files</a></p>
<h3><a name="SeeAlso">See Also</a></h3>

<p>
<a href="../ctrl/iupglcanvas.html">IupGLCanvas</a>, <a href="../elem/iupcanvas.html">IupCanvas</a></p>

</body>

</html>